#!/bin/bash

sudo echo 140800 > /sys/kernel/debug/tracing/buffer_size_kb
sudo echo nop    > /sys/kernel/debug/tracing/current_tracer
sudo echo 0      > /sys/kernel/debug/tracing/tracing_on
sudo echo 0      > /sys/kernel/debug/tracing/trace
sudo echo 1      > /sys/kernel/debug/tracing/events/irq/softirq_entry/enable
sudo echo 1      > /sys/kernel/debug/tracing/events/irq/softirq_exit/enable


# CPU 0-159
# echo ffffffff,ffffffff,ffffffff,ffffffff,ffffffff > /sys/kernel/debug/tracing/tracing_cpumask
sudo echo 1      > /sys/kernel/debug/tracing/tracing_on

sudo sleep 30

sudo echo 0      > /sys/kernel/debug/tracing/events/irq/softirq_entry/enable
sudo echo 0      > /sys/kernel/debug/tracing/events/irq/softirq_exit/enable

sudo echo 0      > /sys/kernel/debug/tracing/tracing_on
sudo cat /sys/kernel/debug/tracing/trace  > ./irq_trace
